package com.scjst.service.imp;

import com.scjst.entity.UserEntity;
import com.scjst.mapper.UserMapper;
import com.scjst.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class UserServiceImp implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    @Transactional
    public int addUser(Integer id, String name, Integer age) {
        Integer operRowCount=userMapper.addUser(id,name,age);
        return  operRowCount;
    }

    @Override
    public List<UserEntity> findAllUser() {
        return  userMapper.findAllUser();
    }

}
